package com.ocom.webapi.controller;

import com.ocom.common.constant.WebApiServiceUrl;
import com.ocom.common.entity.card.EntityXfRepairpayConfig;
import com.ocom.common.entity.payconfig.EntityMealMenu;
import com.ocom.common.entity.payconfig.EntityMealPlan;
import com.ocom.common.request.payconfig.MealPlanListRequest;
import com.ocom.common.request.payconfig.RemoveMealPlanRequest;
import com.ocom.common.request.payconfig.repairpay.GetRepairPayConfigRequest;
import com.ocom.common.request.payconfig.repairpay.GetRepairPayRecordListRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.security.authentication.YoCiUser;
import com.ocom.security.utils.SecurityUtils;
import com.ocom.webapi.feign.PayConfigClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2023/2/22
 **/
@RestController
@PreAuthorize("@pms.hasRole('ROLE_WEB')" )
public class RepairPayController {

	@Autowired
	private PayConfigClientService payConfigClientService;


	@PostMapping(WebApiServiceUrl.Url_RepairPayRecordOnShow)
	public Result repairPayRecordOnShow(@RequestBody GetRepairPayRecordListRequest request){
		return payConfigClientService.getRepairPayRecordList(request);
	}

	@PostMapping(WebApiServiceUrl.Url_RepairPayPageOnShow)
	public Result repairPayPageOnShow(@RequestBody GetRepairPayConfigRequest request){
		return payConfigClientService.getRepairPayConfig(request);
	}

	@PostMapping(WebApiServiceUrl.Url_RepairPayPageModify)
	public Result repairPayPageModify(@RequestBody EntityXfRepairpayConfig request){
		return payConfigClientService.addRepairPayConfig(request);
	}


}
